class CreateUserTypes < ActiveRecord::Migration
  def self.up
    create_table :user_types do |t|
      t.string :name
      t.string :stripped_name
      t.timestamps
    end

    create_table :advertisments_user_types, :id => false do |t|
      t.column :advertisment_id, :integer
      t.column :user_type_id, :integer
    end

    UserType.create({:name => "Student"})
    UserType.create({:name => "Employer"})
    UserType.create({:name => "HousingProvider"})
    UserType.create({:name => "EducationProvider"})
    UserType.create({:name => "CoachingProvider"})
    UserType.create({:name => "Other"})
  end

  def self.down
    drop_table :user_types
    drop_table :advertisments_user_types
  end
end
